﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using DTO;
using DAO;
using BUS;

namespace DoAn
{
    public partial class frmThemPhong : Form
    {
        private List<Rap> dsRap;
        private RapBUS rapBus = new RapBUS();
        public frmThemPhong()
        {
            InitializeComponent();
        }

        private void frmQuanLyPhongChieu_Load(object sender, EventArgs e)
        {
            buttonStatus(true);
            btnThemPhong.Enabled = true;

            cbTinhTrangPhong.Enabled = false;
            btnEdit.Enabled = false;
            btnDelete.Enabled = false;
        }

        private void tsAddPhong_Click(object sender, EventArgs e)
        {
            buttonStatus(true);
        }
        private void buttonStatus(bool status)
        {
            tsEditPhong.Enabled = status;
            tsAddPhong.Enabled = !status;

            btnThemPhong.Enabled = status;
            btnEdit.Enabled = !status;
            btnDelete.Enabled = !status;
            cbTinhTrangPhong.Enabled = !status;

        }

        private void tsEditPhong_Click(object sender, EventArgs e)
        {
            buttonStatus(false);
        }

        private void loadDSRap()
        {
            dsRap = rapBus.layDSRap();
            cbbRap.DataSource = dsRap;
        }
    }
}
